# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Brad Conte <brad AT bradconte.com>

pkgname=ntl
pkgver=11.5.1
pkgrel=1
pkgdesc='A Library for doing Number Theory'
arch=(loong64 x86_64)
url='https://www.shoup.net/ntl/'
license=(LGPL)
depends=(gf2x gmp)
makedepends=()
source=(https://www.shoup.net/$pkgname/$pkgname-$pkgver.tar.gz)
sha256sums=('210d06c31306cbc6eaf6814453c56c776d9d8e8df36d74eb306f6a523d1c6a8a')

prepare() {
  cd $pkgname-$pkgver/src
  rm -r libtool-origin
}

build() {
  cd $pkgname-$pkgver/src
  ./configure DEF_PREFIX=/usr SHARED=on NTL_GF2X_LIB=on NATIVE=off TUNE=x86 \
    LIBTOOL=libtool CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}"
  make
}

check() {
  cd $pkgname-$pkgver/src
  make -k check
}

package() {
  cd $pkgname-$pkgver/src
  make PREFIX="$pkgdir/usr" install
}
